import { _decorator, Component, Node, input, Input, EventTouch } from 'cc'
import { GameManager } from './framework/GameManager'
const { ccclass, property } = _decorator

@ccclass('skill')
export class Skill extends Component {
  @property(GameManager)
  gameManager: GameManager = null

  start() {
    // 监听结束触摸
    this.node.on(Node.EventType.TOUCH_END, event => {
      this.releaseSkill()
      this.node.active = false
      this.scheduleOnce(() => {
        this.node.active = true
      }, 10)
    })
  }
  releaseSkill() {
    // this.gameManager.destroyEnemy() // 销毁子弹和敌机
    this.gameManager.createdSkill() // 创建大招
    this.gameManager.openShield() // 护盾
  }
}
